<template>
  <div class="card1">
    <div class="card1-left">
      <div class="card1-left-text">
        <p class="card1-left-text1">{{ $t('card1.title1') }}</p>
        <p id="card1-left-text2">{{ $t('card1.title2') }}</p>
        <p id="card1-left-text3">{{ $t('card1.description') }}</p>
        <div class="card1-left-button" @click="handleLoginClick">
          {{ $t('card1.loginRegister') }}
        </div>
      </div>
    </div>
    <div class="card1-right">
      <video controls>
        <source src="https://6c6f-lowcode-7gsgcnyn3843699e-1325402149.tcb.qcloud.la/video(1).mp4" type="video/mp4">
      </video>
    </div>
  </div>
</template>

<script>
export default {
  name: 'MyCard1',
  methods: {
    handleLoginClick() {
      window.location.href = 'https://cschain.cn/test/index/';
    }
  }
}
</script>

<style scoped>
.card1 {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: url("https://lowcode-7gsgcnyn3843699e-1325402149.tcloudbaseapp.com/resources/2024-07/lowcode-1870996");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.card1::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(29, 116, 223, 0.679), rgba(29, 168, 203, 0.513));
  z-index: 1;
}

.card1-left {
  width: 50%;
  height: 100%;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

.card1-right {
  width: 50%;
  height: 100%;
  max-width: 50%;
  position: relative;
  z-index: 2;
}

video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: black;
}

.card1-left-text {
  margin-top: 26%;
  margin-left: 6%;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card1-left-text1 {
  font-size: 3vw;
  margin-bottom: -1%;
  font-weight: 1000;
}

#card1-left-text2 {
  font-size: 2vw;
  margin-bottom: 1rem;
  font-weight: 1000;

}

#card1-left-text3 {
  text-align: left;
  font-size: 1vw;
  font-weight: 100;
}

.card1-left-text1,
#card1-left-text2,
#card1-left-text3 {
  font-family: "STSong", "华文中宋", serif;
}

.card1-left-button {
  width: 10vw;
  height: 7vh;
  font-size: 1.5vw;
  display: flex;
  margin-top: 12vh;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  color: rgb(255, 255, 255);
  font-weight: bold;
  border: 1px solid rgb(255, 255, 255);
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.5s, transform 0.5s, color 0.3s;
  font-family: "STSong", "华文中宋", serif;
}

.card1-left-button:hover {
  background: rgb(155, 203, 251);
  color: rgb(255, 255, 255);
}

@media (max-width: 768px) {
  .card1 {
    flex-direction: column;
    align-items: center;
    position: static; /* 让卡片在移动端不固定在视口 */
    z-index: auto; /* 确保不遮挡其他内容 */
  }

  .card1-left {
    width: 100%;
    text-align: center;
    height: 70%;
  }

  .card1-right {
    width: 100%;
    height: auto;
    max-width: 100%;
    padding: 0 20px;
  }

  video {
    position: static; /* 让视频在移动端跟随文档流 */
    width: 100%;
    height: auto;
    margin-top: -20px; /* 调整此值以向上移动视频 */
  }

  #card1-left-text2 {
    font-size: 18px;
  }

  .card1-left-button {
    width: 100px;
    height: 40px;
    font-size: 18px;
  }
}
</style>
